﻿<%@ Page Language="VB" MasterPageFile="~/WebForm/MasterPage.master" AutoEventWireup="false"
    CodeFile="ManageInsurance.aspx.vb" Inherits="WebForm_ManageInsurance" %>

<%@ Register Namespace="My" TagPrefix="cc1" %>
<%@ Register Src="~/WebForm/CommonControl/VolunteerQueryControl.ascx" TagName="VolunteerQueryControl"
    TagPrefix="uc3" %>
<%@ Reference Control="~/WebForm/CommonControl/CalendarTextBox.ascx" %>

<script runat="server" language="VB" src="~/WebForm/ManageInsurance/List_PL.aspx.vb">
</script>

<script runat="server" language="VB" src="~/WebForm/ManageInsurance/List_BLL.aspx.vb">
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table align="center" width="95%">
        <tr>
            <td align="center">
                <asp:Label ID="Title" runat="server" SkinID="title" meta:resourcekey="Page"></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
            </td>
        </tr>
<%--        <tr>
            <td align="left">
                <asp:Label ID="lblUsage" runat="server" SkinID="Alert"></asp:Label>
            </td>
        </tr>--%>
    </table>    
    <table align="center" width="95%">
        <tr class="ToolBox">
            <td align="left">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td align="left">
                <fieldset align="left">
                    <legend>
                        <asp:Label ID="lblSearchParameter" runat="server" meta:resourcekey="lblSearchParameter"></asp:Label>
                    </legend>
                    <uc3:VolunteerQueryControl ID="VolunteerQueryControl1" runat="server" LoadOnStartUp="true" />
                    <table>
                        <tr>
                            <td align="right">
                                <asp:Label ID="lblInsuranceEndDate" runat="server" meta:resourcekey="lblInsuranceEndDate"></asp:Label>
                            </td>
                            <td align="left">
                                <My:CalendarTextBox ID="txtInsuranceEndDate" runat="server" />
                                <%--<asp:TextBox ID="txtInsuranceEndDate" runat="server"></asp:TextBox>--%>
                                <%--                                <asp:ImageButton runat="Server" ID="ibtnInsuranceDate" ImageUrl="~/images/Calendar_scheduleHS.png" />
                                <ajaxToolkit:CalendarExtender ID="ceInsuranceDate" runat="server" TargetControlID="txtInsuranceEndDate"
                                    PopupButtonID="ibtnInsuranceDate" />
                                <asp:CompareValidator ID="vadInsuranceEndDate" runat="server" ControlToValidate="txtInsuranceEndDate"
                                    Display="None" Operator="DataTypeCheck" Type="Date" meta:resourcekey="vadInsuranceEndDate"></asp:CompareValidator>--%>
                            </td>
                        </tr>
                    </table>
                    <asp:ValidationSummary ID="summary1" runat="server" />
                </fieldset>
                <br />
            </td>
        </tr>
        <tr class="ToolBox">
            <td align="right">
                <table cellpadding="0" cellspacing="0">
                    <tr>
                        <td>
                            <asp:Button ID="btnList" BorderStyle="Ridge" BorderWidth="1" BorderColor="lightblue"
                                runat="server" meta:resourcekey="btnList" />
                        </td>
                        <td>
                            <asp:Button ID="btnExportView" runat="server" meta:resourcekey="btnExportView" Visible="false" />
                        </td>
                        <td>
                            <asp:Button ID="btnExport" runat="server" meta:resourcekey="btnExport" />
                        </td>
                        <td>
                            <asp:Button ID="btnImport" runat="server" meta:resourcekey="btnImport" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <ajaxToolkit:TabContainer ID="Container1" runat="server">
                    <ajaxToolkit:TabPanel ID="ListTabPanel" runat="server" meta:resourcekey="ListTabPanel">
                        <ContentTemplate>
                            <My:MyGridView ID="gv" runat="server" SkinID="pager" AllowPaging="True" AllowHoverSelect="False"
                                DataKeyNames="VolunteerID,VOrganizationID" AllowHoverEffect="True" MySortDirection="Ascending"
                                AutoGenerateColumns="False" MySortExpression="v.VolunteerID" AllowSorting="true"
                                meta:resourcekey="gv">
                                <Columns>
                                  <My:VolunteerIDBoundField DataField="VolunteerID" meta:resourcekey="bfVolunteerID"
                                   ReadOnly="True" SortExpression="v.VolunteerID" />
<%--                                    <asp:BoundField DataField="VolunteerID" meta:resourcekey="bfVolunteerID" SortExpression="v.VolunteerID" />
--%>                                    <asp:BoundField DataField="VolunteerName" meta:resourcekey="bfVolunteerName" SortExpression="v.VolunteerName" />
                                    <asp:BoundField DataField="OrganizationName" meta:resourcekey="bfOrganizationName" />
                                    <asp:BoundField DataField="VOrganizationName" meta:resourcekey="bfVOrganizationName" />
                                    <asp:BoundField DataField="InsuranceEndDate" meta:resourcekey="bfInsuraceEndDate" SortExpression="EndDate" />
                                </Columns>
                            </My:MyGridView>
                        </ContentTemplate>
                    </ajaxToolkit:TabPanel>
                    <ajaxToolkit:TabPanel ID="UploadTabPanel" runat="server" meta:resourcekey="UploadTabPanel">
                        <ContentTemplate>
                            <table>
                                <tr>
                                    <td align="right">
                                        <asp:Label ID="lblInsuranceType" runat="server" meta:resourcekey="lblInsuranceType"></asp:Label>
                                    </td>
                                    <td align="left">
                                        <My:CodeMappingDropDownList ID="ddlInsuranceType" runat="server" DataSourceID="odsInsuranceType">
                                        </My:CodeMappingDropDownList>
                                        <My:CodeMappingSqlDataSource ID="odsInsuranceType" runat="server" TableName="Insurance"
                                            ColumnName="Type">
                                        </My:CodeMappingSqlDataSource>
                                    </td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Label ID="lblInsuranceOrg" runat="server" meta:resourcekey="lblInsuranceOrg"></asp:Label>
                                    </td>
                                    <td align="left">
                                        <asp:TextBox ID="txtlblInsuranceOrg" runat="server" ></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="rfvInsuranceOrg" runat="server" ErrorMessage="請輸入投保單位" 
                                            ControlToValidate="txtlblInsuranceOrg" ValidationGroup="vUpload" Display="None"></asp:RequiredFieldValidator>
                                    </td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Label ID="lblCompany" runat="server" meta:resourcekey="lblCompany"></asp:Label>
                                    </td>
                                    <td align="left">
                                        <My:CodeMappingDropDownList ID="ddlCompany" runat="server" DataSourceID="odsCompany">
                                        </My:CodeMappingDropDownList>
                                        <My:CodeMappingSqlDataSource ID="odsCompany" runat="server" TableName="Insurance"
                                            ColumnName="ComPany">
                                        </My:CodeMappingSqlDataSource>
                                    </td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Label ID="lblMoneyLevel" runat="server" meta:resourcekey="lblMoneyLevel"></asp:Label>
                                    </td>
                                    <td align="left">
                                        <asp:TextBox ID="txtMoneyLevel" runat="server" ></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="請輸入投保金額" 
                                            ControlToValidate="txtMoneyLevel" ValidationGroup="vUpload" Display="None"></asp:RequiredFieldValidator>
                                        <asp:CompareValidator ID="CompareValidator1" ControlToValidate="txtMoneyLevel" Display="None" Operator="DataTypeCheck"
                                             ValidationGroup="vUpload"  Type="Integer" runat="server" ErrorMessage="投保金額必須為數字"></asp:CompareValidator>
                                    </td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Label ID="lblCharge" runat="server" meta:resourcekey="lblCharge"></asp:Label>
                                    </td>
                                    <td align="left">
                                        <asp:TextBox ID="txtCharge" runat="server" ></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="請輸入投保費用" 
                                            ControlToValidate="txtCharge" ValidationGroup="vUpload" Display="None"></asp:RequiredFieldValidator>
                                        <asp:CompareValidator ID="CompareValidator2" ControlToValidate="txtCharge" Display="None" Operator="DataTypeCheck"
                                             ValidationGroup="vUpload"  Type="Integer" runat="server" ErrorMessage="投保費用必須為數字"></asp:CompareValidator>
                                    </td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <asp:Label ID="lblFileName" runat="server" meta:resourcekey="lblFileName"></asp:Label>
                                    </td>
                                    <td align="left">
                                        <asp:FileUpload ID="fuInsurance" runat="server" />
                                    </td>
                                    <td>
                                        <asp:Button ID="btnUpload" runat="server" meta:resourcekey="btnUpload" ValidationGroup="vUpload" />
                                    </td>
                                </tr>
                            </table>
                            <asp:ValidationSummary ID="ValidationSummary1" ShowMessageBox="true" ShowSummary="false" 
                                ValidationGroup="vUpload" runat="server" />
                        </ContentTemplate>
                    </ajaxToolkit:TabPanel>
                </ajaxToolkit:TabContainer>
            </td>
        </tr>
    </table>
</asp:Content>
